package d1104r214;

public class Animal {
    protected String name;

    public Animal(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    //方法
    protected void eat(Food food){
        //输出食物的名称
        System.out.println(this.name+"正在吃"+food.getName());

    }
    protected void shout(){

    }
}
